package com.zyh.status;
import com.zyh.utils.GetNumber;
import com.zyh.utils.JdbcUtils;
import com.zyh.utils.Menu;

public class NotLogin {
    private GetNumber getNumber;
    private JdbcUtils jdbcUtils;
    private Menu menu;

    public NotLogin() {
        this.getNumber = new GetNumber();
        this.jdbcUtils = new JdbcUtils();
        this.menu = new Menu();
    }

    public void failed() {
        menu.userMenu();
        int option = getNumber.getUserInputAsInt();
        switch (option) {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
                System.out.println("请先登录!");
                break;
            case 0:
                System.out.println("退出到登录页面成功! ");
                jdbcUtils.closeAllConnections();
                return;
            default:
                System.out.println("无效选项, 请重试! ");
                break;
        }
    }
}
